#include <stdio.h>

int main(int argc, char *argv[]) {

    /**
     * @brief 问题分析
     * 1.从2到22 相当于2+2*10+2
     *   从22到222 相当于2+ (2*10+2) + ((2*10+2)*10+2)
     */

    int n, num, res=0,temp;
    scanf("%d %d", &n, &num);
    temp = num;

    for (size_t i = 0; i < n; i++)
    {
        res += num;
        num = num * 10 + temp;
    }

    printf("%d", res);

    return 0;
}